#include "n2base.h"

int little_endian = 1;

int is_little_endian(void)
{
    union
    {
        unsigned int  int_data;
        unsigned char byte_data;
    }u;
    u.int_data = 0x12345678;
    if(u.byte_data==0x78)
        return 1;
    else
        return 0;
}

unsigned short MKLE16(unsigned short v)
{
    if (is_little_endian())
        return v;
    else
        return N2Swap16(v);
}

unsigned int MKLE32(unsigned int v)
{
    if (is_little_endian())
        return v;
    else
        return N2Swap32(v);
}

unsigned long long MKLE64(unsigned long long v)
{
    if (is_little_endian())
        return v;
    else
        return N2Swap64(v);
}

